// JavaScript Document
function state()
{
	var buyId=document.getElementsByClassName("buycolDiv").item(0);
	var buyA_id=buyId.getElementsByTagName("a");
	var buyCond=document.getElementsByClassName("buyCondition").item(0);
	var buycdSpanID=document.getElementsByClassName("buycdSpan");
	var buycdImgID=document.getElementsByClassName("buycdImg");
	buycdImgID.item(0).onclick=function()
	{
		var buySpInd=buyCond.getElementsByTagName("span").item(0);
		buyCond.removeChild(buySpInd);
		buyA_id.item(0).className="";
	}
	for(var i=0;i<buyA_id.length;i++)
	{
		buyA_id.item(i).index=i;
		buyA_id.item(i).onclick=function()
		{
			for(var i=0;i<buyA_id.length;i++)
			{
				buyA_id.item(i).className="";
			}
			this.className="bcAover";
			buyCond.insertAdjacentHTML("beforeEnd",'<span class="buycdSpan"><img class="buycdImg" src="images/close.jpg" /><font>'+this.innerHTML+'</font></span>');
			var buycdImgID=document.getElementsByClassName("buycdImg");
			if(buycdImgID.length>1)
			{
				buyCond.removeChild(buyCond.getElementsByTagName("span").item(0));
			}
			buycdImgID.item(0).onclick=function()
			{
				var buySpInd=buyCond.getElementsByTagName("span").item(0);
				buyCond.removeChild(buySpInd);
				for(var i=0;i<buyA_id.length;i++)
				{
					buyA_id.item(i).className="";
				}
			}
		}
	}
}
state();
//以上为我的收藏中状态特效
function delGoods()
{
	var closeImg=document.getElementsByClassName("buyImg");
	var buyDivRo=document.getElementsByClassName("buycondDiv2").item(0).getElementsByTagName("ul").item(0);
	var buyLiId=buyDivRo.getElementsByTagName("li");
	for(var i=0;i<closeImg.length;i++)
	{
		closeImg.item(i).index=i;
		closeImg.item(i).onclick=function()
		{
			var indexId=this.index;							
			if(confirm("是否删除"))
			{
				var remLi=buyLiId.item(indexId);
				buyDivRo.removeChild(remLi);
			}
			else
			{
				
			}
		}
	}
}
delGoods();
//以上为我的收藏中商品删除特效